<template>
  <div>
    <div class="swiper-container">
      <div class="swiper-wrapper">
        <div class="swiper-slide">
          <img src="../assets/images/html.png" alt="" />
        </div>
        <div class="swiper-slide">
          <img src="../assets/images/react.png" alt="" />
        </div>
        <div class="swiper-slide">
          <img src="../assets/images/vue.png" alt="" />
        </div>
      </div>
      <!-- 如果需要分页器 -->
      <div class="swiper-pagination"></div>

      <!-- 如果需要导航按钮 -->
      <div class="swiper-button-prev"></div>
      <div class="swiper-button-next"></div>

      <!-- 如果需要滚动条 -->
    </div>
  </div>
</template>

<script>
import "../assets/swiper.min.css";
import Swiper from "swiper";
export default {
  mounted() {
    new Swiper(".swiper-container", {
      loop: true, // 循环模式选项
      autoplay: {
        delay: 1000,
      },

      // 如果需要分页器
      pagination: {
        el: ".swiper-pagination",
      },

      // 如果需要前进后退按钮
      navigation: {
        nextEl: ".swiper-button-next",
        prevEl: ".swiper-button-prev",
      },

      // 如果需要滚动条
    });
  },
};
</script>

<style lang="scss" scoped>
.swiper-slide {
  width: 100%;
  img {
    height: 300px;
    width: 100%;
  }
}
</style>